jQuery(document).ready(function() {
	
	var questionsId = getUrlParam('questionsId');
	initForm(questionsId);
	
	$('#back').click(function(){
		window.history.back(-1);
	});
	
	
});	
function initForm(questionsId){

	var infoUrl = projectPath + "questions/list.do";
	
	$.ajax({ 
		url: infoUrl,
		method: 'post',
		data:JSON.stringify({"questionsId": questionsId}),
		dataType: "json",
		contentType: "application/json",
		success: function(data){
			$("#title").html(data.rows[0].title);
			if(data.rows[0].content != ''){
				$("#title").html(data.rows[0].content);
			}
			$("#orgName").html(data.rows[0].orgName);
			$("#replyContent").html(data.rows[0].replyContent);
      	}
	});
}

window.operateEvents = {
	'click .detail': function (e, value, row, index) {
		window.location.href = './detail.html'
		console.log(row);
//		var pk = row.questionsId;
//		$("#modalRepository").modal('show');
//		console.log(row);
//		$("#code").html(row.repositoryCode);
//		$("#tit").html(row.repositoryTitle);
//		$("#big").html(row.bigClass);
//		$("#small").html(row.smallClass);
//		$("#keyword").html(row.keyWord);
//		$("#state").html(row.status);
//		$("#detail").html(row.detail);
//		addViewCount(pk);
	}
};


